package netty.buf;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

/**
 * Created by yu756 on 2020/1/6 22:18
 */
public class NettyByteBuf01 {

    public static void main(String[] args) {
        // 一个数组arr byte[10]
        ByteBuf buffer = Unpooled.buffer(10);

        for (int i = 0; i < 10; i++) {
            buffer.writeByte(i);
        }
        //buffer.capacity 容量
        for (int i = 0; i < buffer.capacity(); i++) {
            System.out.println(buffer.readByte());
        }


    }


}
